using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Salesunitgoodsreport : IAccessible<T_Salesunitgoodsreport, Salesunitgoodsreport>, ILogicEntity<T_Salesunitgoodsreport, Salesunitgoodsreport>
    {
        public int ID { get; set; }

        public string Year { get; set; }

        public string Month { get; set; }

        public int SalesUnitID { get; set; }

        public int GoodsID { get; set; }

        public int ReceivedAmount { get; set; }

        public int StockAmount { get; set; }

        public int SaledAmount { get; set; }

        public decimal SaledMoney { get; set; }

        protected override void Covariant(T_Salesunitgoodsreport model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.Year = model.Year;
                    this.Month = model.Month;
                    this.SalesUnitID = model.SalesUnitID;
                    this.GoodsID = model.GoodsID;
                    this.ReceivedAmount = model.ReceivedAmount;
                    this.StockAmount = model.StockAmount;
                    this.SaledAmount = model.SaledAmount;
                    this.SaledMoney = model.SaledMoney;
            }
}
        protected override T_Salesunitgoodsreport Inverter(Salesunitgoodsreport model)
        {
            if (model != null)
            {
                return new T_Salesunitgoodsreport()
                {
                    ID = model.ID,
                    Year = model.Year,
                    Month = model.Month,
                    SalesUnitID = model.SalesUnitID,
                    GoodsID = model.GoodsID,
                    ReceivedAmount = model.ReceivedAmount,
                    StockAmount = model.StockAmount,
                    SaledAmount = model.SaledAmount,
                    SaledMoney = model.SaledMoney,
                };
            }
            return null;
        }
        public Salesunitgoodsreport Set(T_Salesunitgoodsreport dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
